/*
 * @Description:
 * @Author: william
 * @Date: 2024-08-08 14:17:49
 * @LastEditors: william
 * @LastEditTime: 2024-08-08 14:43:45
 */

/**
 * 自动引入api目录下所有文件的内容暴露
 * @author william
 * @date 2024/1/10 - 17:06:51
 *
 * @type {*}
 */

const modulesFiles = import.meta.glob('./**/*.js', { eager: true })

const apiModules = {}
for (const [key, apiValue] of Object.entries(modulesFiles)) {
  const moduleName = key.match(/.*\/(.+).js$/)[1]
  apiModules[moduleName] = apiValue
}

export { apiModules }
